package com.liu.learning.manual_paper.controller;

import com.liu.learning.manual_paper.dto.PaperQuestionsDTO;
import com.liu.learning.manual_paper.service.SelectQuestionService;
import com.our.learning.infrastructure.pojo.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/manual_questions")
public class SelectQuestionController {

    @Autowired
    private final SelectQuestionService selectQuestionService;

    public SelectQuestionController(SelectQuestionService selectQuestionService) {
        this.selectQuestionService = selectQuestionService;
    }
//    @PostMapping("/create")
//    public Response createPaper(@RequestParam String name) {
//        return selectQuestionService.createPaper(name);
//    }

    @PostMapping
    public Response addQuestionToPaper(@RequestBody PaperQuestionsDTO paperQuestionsDTO) {
        return selectQuestionService.addQuestionToPaper(paperQuestionsDTO);
    }



}
